package
{
	import alternativa.engine3d.core.Mesh;
	import alternativa.engine3d.materials.FillMaterial;
	
	public class Cageescalier extends Mesh
	{
		public function Cageescalier()
		{
				
			var wallsFacesMur:Array = [];
			var wallsFacesSol:Array = [];
			
			//Bas
			createVertex(0,600,0,0);
			createVertex(400,600,0,1);
			createVertex(400,0,0,2);
			createVertex(0,0,0,3);
			
			//Haut
			createVertex(0,600,1800,4);
			createVertex(400,600,1800,5);
			createVertex(400,0,1800,6);
			createVertex(0,0,1800,7);
			
			//Face porte
			createVertex(0,450,0,9);
			createVertex(0,450,1800,10);
			
			//Face sol 1 escalier
			createVertex(0,600,150,11);
			createVertex(400,600,150,12);
			createVertex(400,500,150,13);
			createVertex(0,500,150,14);
			
			createVertex(0,0,300,15);
			createVertex(400,0,300,16);
			createVertex(400,350,300,17);
			createVertex(0,350,300,18);
			
			//Face sol 2 escalier
			createVertex(0,600,450,21);
			createVertex(400,600,450,22);
			createVertex(400,500,450,23);
			createVertex(0,500,450,24);
			
			createVertex(0,0,600,25);
			createVertex(400,0,600,26);
			createVertex(400,350,600,27);
			createVertex(0,350,600,28);
			
			//Face sol 3 escalier
			createVertex(0,600,750,31);
			createVertex(400,600,750,32);
			createVertex(400,500,750,33);
			createVertex(0,500,750,34);
			
			createVertex(0,0,900,35);
			createVertex(400,0,900,36);
			createVertex(400,350,900,37);
			createVertex(0,350,900,38);
			
			//Face sol 4 escalier
			createVertex(0,600,1050,41);
			createVertex(400,600,1050,42);
			createVertex(400,500,1050,43);
			createVertex(0,500,1050,44);
			
			createVertex(0,0,1200,45);
			createVertex(400,0,1200,46);
			createVertex(400,350,1200,47);
			createVertex(0,350,1200,48);
			
			//Face sol 5 escalier
			createVertex(0,600,1350,51);
			createVertex(400,600,1350,52);
			createVertex(400,500,1350,53);
			createVertex(0,500,1350,54);
			
			createVertex(0,0,1500,55);
			createVertex(400,0,1500,56);
			createVertex(400,350,1500,57);
			createVertex(0,350,1500,58);
			
			wallsFacesMur.push(createFace([3,2,1,0],"sl"));
			wallsFacesMur.push(createFace([4,5,6,7],"pf"));
			wallsFacesMur.push(createFace([0,1,5,4],"fn"));
			wallsFacesMur.push(createFace([1,2,6,5],"fo"));
			wallsFacesMur.push(createFace([2,3,7,6],"fs"));
			wallsFacesMur.push(createFace([9,0,4,10],"fe"));
			
			//sol 1 escalier
			wallsFacesSol.push(createFace([11,12,13,14],"f1"));
			wallsFacesSol.push(createFace([14,13,12,11],"f2"));
			
			wallsFacesSol.push(createFace([15,16,17,18],"f1e"));
			wallsFacesSol.push(createFace([18,17,16,15],"f2e"));
			
			//sol 2 escalier
			wallsFacesSol.push(createFace([21,22,23,24],"f3"));
			wallsFacesSol.push(createFace([24,23,22,21],"f4"));
			
			wallsFacesSol.push(createFace([25,26,27,28],"f3e"));
			wallsFacesSol.push(createFace([28,27,26,25],"f4e"));
			
			//sol 3 escalier
			wallsFacesSol.push(createFace([31,32,33,34],"f5"));
			wallsFacesSol.push(createFace([34,33,32,31],"f6"));
			
			wallsFacesSol.push(createFace([35,36,37,38],"f5e"));
			wallsFacesSol.push(createFace([38,37,36,35],"f6e"));
			
			//sol 4 escalier
			wallsFacesSol.push(createFace([41,42,43,44],"f7"));
			wallsFacesSol.push(createFace([44,43,42,41],"f8"));
			
			wallsFacesSol.push(createFace([45,46,47,48],"f7e"));
			wallsFacesSol.push(createFace([48,47,46,45],"f8e"));
			//sol 5 escalier
			wallsFacesSol.push(createFace([51,52,53,54],"f9"));
			wallsFacesSol.push(createFace([54,53,52,51],"f10"));
			
			wallsFacesSol.push(createFace([55,56,57,58],"f9e"));
			wallsFacesSol.push(createFace([58,57,56,55],"f10e"));
			
		
			createSurface(wallsFacesMur,"Mur");
			createSurface(wallsFacesSol,"Sol");
			//moveAllFacesToSurface("temp");
			setMaterialToSurface(new FillMaterial(0x888888,1,"normal",1,0x000000),"Mur");
			setMaterialToSurface(new FillMaterial(0xCCCCCC,1,"normal",1,0x000000),"Sol");
			
		}

	}
}